package leetcode.easy;

import leetcode.base.TreeNode;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

/**
 * ClassName: $94_InorderTraversal
 * Description:
 * date: 2021-11-17 22:01
 *
 * @author liyifan
 */
public class $94_InorderTraversal {

    private List<Integer> res = new LinkedList<>();

    public List<Integer> inorderTraversal(TreeNode root) {
        inorder(root);
        return res;
    }

    public void inorder(TreeNode root){
        if (root == null)
            return;
        inorder(root.left);
        res.add(root.val);
        inorder(root.right);
    }
}
